<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table = 'user_info';
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    protected $fillable = ['nickname','realname','sign','phone','sex','idcard','avatar','openId','unionid','password','status','first_login_time','login_time'];

    /**
     * 获取性别
     * @param [type] $sex
     * @method getSex
     * @author chengzhigang<1256699215@qq.com>
     */
    public static function getSex($sex){
        switch($sex){
            case 1:
                return '男';
                break;
            case 2:
                return '女';
                break;
            default:
                return '未知';
                break;
        }
    }
}
